package com.demo2do.fms.admin.dao.data;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.demo2do.fms.entity.data.cost.RoadBridgeFee;

/**
 * 
 * @author Ysy
 *
 */
@Dao("hibernate")
public interface RoadBridgeFeeDao {
    
    /**
     * list distinct organization ids
     * 
     * @param orgIds
     * @return
     */
    @Query("SELECT distinct fee.organization.id FROM RoadBridgeFee fee WHERE fee.organization.id IN (:orgIds) AND fee.disabled = false ORDER BY fee.organization.id ASC")
    public List<Long> listOrganization(@Variable("orgIds")List<Long> orgIds);
    
    /**
     * list road_bridge_fee by organization id
     * 
     * @param orgId
     * @return
     */
    @Query("FROM RoadBridgeFee WHERE organization.id = :orgId AND disabled = false ORDER BY organization ASC, emp ASC, ton ASC")
    public List<RoadBridgeFee> list(@Variable("orgId")Long orgId);
    
}
